#include <stdio.h>

FILE *fp;

int main(int argc, char *argv[])
{
    int c, line = 1;
    fp = fopen(argv[1], "r");

    while ((c = getc(fp)) != EOF)
    {
        //putc(c, gp);
        if (c == '\n')
            line++;
    }
    fclose(fp);
    printf("line = %d\n", line);
    return 0;
}